/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package assign1;

/**
 *
 * @author kevin louis
 */
/**traffic light class*/
public class trafficLight {
    private boolean horRed = true;
    private boolean verRed = true;
    private int state = 1;
/**change light for traffic light*/
    public void trafficRun(int cycleNum) {
        if (cycleNum % 4 == 0) {
            if (horRed == true && state == 2) {
               // System.out.print('R');
                horRed = false;
            } else if (horRed == false) {
               // System.out.print('G');
                horRed = true;
            }
            if (verRed == true && state == 4) {
                verRed = false;
            } else if (verRed == false) {
                verRed = true;
            }
            state++;
            if (state > 4) {
                state = 1;
            }
        }
    }

    public boolean getHorRed() {/**getter for red light from horizontal lane */
        return horRed;
    }

    public boolean getVerRed() {/**getter for red light from vertical line*/
        return verRed;
    }
}
